import request from '@/utils/request';

export default{
    //获取广告列表
    //POST /manage_system/advertise/AdvertisePageQuery/{page}/{limit}
    getAdvList(token,page,limit){
        return request({
            // params:{token:token},
            url:(`/service_manage/GG/GGPageQuery/${page}/${limit}?token=${token}`),
            method:'post',
        })
        
    },

    //添加和编辑广告
    //POST /manage_system/advertise/addAdvertise
    //POST /manage_system/advertise/modifyAdvertise
    addOrUpdate(token,advlist){
        if(advlist.id){
            return request({
                params:{token:token},
                url:(`/service_manage/GG/modifyGG`),
                data:advlist,
                method:'post',
            })
            // return request.post('/manage_system/user-wechat/modifyUserWechat',userlist,params=getToken())
        }else{
            return request({
                params:{token:token},
                url:(`/service_manage/GG/addGG`),
                data:advlist,
                method:'post',
            })
        }
    },

    //删除广告
    //DELETE /manage_system/advertise/deleteAdvertise
    //DELETE /service_manage/advertise/deleteAdvertise
    deleteAdv(token,id){
        return request({
            // params:{token:token},
            params:{token:token,id:id},
            url:(`/service_manage/GG/deleteGG`),
            method:'delete'

        })
    },
}
    